/* Modal Overlay */
.avatar-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 30000;
    /* Higher than other modals */
}

/* Modal Content */
.avatar-modal-content {
    background: #fff;
    width: 400px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
.avatar-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.avatar-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.close-avatar-modal {
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.close-avatar-modal:hover {
    color: #333;
}

/* Editor Container */
.avatar-editor-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Upload & Preview Area */
.avatar-upload-area {
    width: 270px;
    /* Reduced by 10% from 300px */
    height: 270px;
    /* Reduced by 10% from 300px */
    background: #f5f5f5;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.default-avatar-placeholder {
    text-align: center;
    color: #999;
}

.default-avatar-placeholder p {
    margin-top: 10px;
    font-size: 14px;
}

/* Editor Wrapper */
.editor-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    cursor: grab;
}

.editor-wrapper:active {
    cursor: grabbing;
}

#editing-image {
    position: absolute;
    /* Centered initially */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    transform-origin: center;
    max-width: none;
    /* Allow scaling beyond container */
    max-height: none;
    user-select: none;
}

/* Overlay with hole */
.editor-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass specific interactions if needed, but here mainly visual */
}

/* 
   Using box-shadow to create a "hole" effect.
   The box itself is transparent (the hole).
   The shadow is the dark overlay.
*/
.crop-box {
    width: 165px;
    /* Increased by 10% from 150px */
    height: 165px;
    border: 2px solid #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

/* Footer & Controls */
.avatar-modal-footer {
    margin-top: 20px;
    width: 100%;
    text-align: center;
}

.instruction-text {
    font-size: 12px;
    color: #999;
    margin-bottom: 15px;
}

.footer-buttons {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.upload-avatar-btn,
.save-avatar-btn {
    background: #221e1d;
    color: #fff;
    border: none;
    padding: 8px 30px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.upload-avatar-btn:hover,
.save-avatar-btn:hover {
    background: #333;
}